var member;
$(function(){
	//修改密码
	$('.modify_psw button').click(function(){
		var $conPsw = $('.confirm_psw input').val();
		var $newPsw = $('.new_psw input').val();
		if($conPsw != $newPsw){
			$('.confirm_psw i').css('display','inline-block');
		};
	});
	$('.confirm_psw input').keydown(function(){
		$(this).next().css('display','none');
	});
	
	member=getEntity("memberInfo");
	$("#mPhone").text(member.mPhone);
	$("#mId").val(member.mId);
	
})
function modifyPassword(){
	var mPwd=$("#newPwd").val();
	var confirmPwd=$("#confirmPwd").val();
	if(mPwd!=confirmPwd){
		$("#msg").text("两次输入密码不一致");
		$("#msg").css("font-size","28px")
		.css("text-align","center")
		.css("margin-top","66px")
		.css("margin-bottom","-50px")
		.css("color","red");
		return false;
	}
	
	var data = $("form").serialize();
	$.ajax({
	type:"post",
	url:rootPath+"/member/updatePwd",
	data:data,
	success:function(data){
		if(data.resultSuccess){
			$("#msg").text("");
			window.location.href=rootPath+"/member/loginPre";
		}else{
			$("#msg").text(data.resultDesc)
			$("#msg").css("font-size","28px")
			.css("text-align","center")
			.css("margin-top","66px")
			.css("margin-bottom","-50px")
			.css("color","red");
		}	
		}
	})
}